/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_status_bar.h
 * Author:          Dan Yin
 * Date:            2023-06-08
 * Description:     status info class
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_STATUS_BAR_H
#define FORM_STATUS_BAR_H

// add necessary includes here
#include "ui/defines/global.h"

class ScreenshotThread : public QThread
{
    Q_OBJECT

public:
    // The default constructor
    ScreenshotThread(QObject *parent){
        qDebug() << Q_FUNC_INFO;
        m_pParent = parent;
    }

    // Default thread function
    void run();

private:
    QObject *       m_pParent;
};

namespace Ui {
class FormStatusBar;
}

class FormStatusBar : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormStatusBar" class, if exist, return it
    static FormStatusBar* getInstance(QWidget *pParent = nullptr);

signals:

private slots:
    // Exec screenshot after click the button
    void on_pushButton_SystemVersion_clicked();

    // Display the current time
    void slotShowCurrentTime();

    // The slot that refresh login mode on the status bar
    void slotRefreshLoginMode(int eumLoginMode);

private:
    // The default constructor
    explicit FormStatusBar(QWidget *parent = nullptr);

    // The default destructor
    virtual ~FormStatusBar();

    // After constructing object, initialize the object
    void _initialze();

    // Init the window style
    void _initUi();

    // Display product name
    void _showProductName();

private:
    Ui::FormStatusBar *ui;

    QTimer              *m_pTimerNow = nullptr;
    ScreenshotThread *  m_pScreenshotThread = nullptr;
};

#endif // FORM_STATUS_BAR_H
